package com.qwz.example;
/**  
* @Description: 观察者模式客户端
* @Package com.qwz.example.Client
* @author Qiuwuzhi
* @date 2019/12/24 10:10
* @version V1.0
*/
public class Client {
    public static void main(String[] args) {
        //创建一份报纸，作为被观察者
        NewsPaper subject = new NewsPaper();
        //创建读者，作为观察者
        Reader reader1 = new Reader();
        reader1.setName("zs");
        Reader reader2 = new Reader();
        reader2.setName("ls");

        subject.attach(reader1);
        subject.attach(reader2);

        subject.setContent("本期内容是观察者模式");
    }
}
